package com.qiang;

import com.qiang.domain.Actor;

import java.util.ArrayList;
import java.util.stream.Stream;

public class Test13 {
    public static void main(String[] args) {
        /*
         男演员只要名字为3个字的前三人
  女演员只要姓林的，并且不要第一个
  把过滤后的男演员姓名和女演员姓名合并到一起
  把上一步操作后的元素作为构造方法的参数创建演员对象,遍历数据
         */
        ArrayList<String> manList = new ArrayList<String>();
        manList.add("周润发");
        manList.add("成龙");
        manList.add("刘德华");
        manList.add("吴京");
        manList.add("周星驰");
        manList.add("李连杰");

        Stream<String> limit = manList.stream().filter(s -> s.length() == 3).limit(3);

        ArrayList<String> womanList = new ArrayList<String>();
        womanList.add("林心如");
        womanList.add("张曼玉");
        womanList.add("林青霞");
        womanList.add("柳岩");
        womanList.add("林志玲");
        womanList.add("王祖贤");

        Stream<String> lin = womanList.stream().filter(s -> s.startsWith("林")).skip(1);
        Stream<String> concat = Stream.concat(limit, lin);

        Actor actor = new Actor();

        concat.forEach((String name) -> {
            System.out.println(new Actor(name));
            //System.out.println(actor.setName(name));
        });


        //actor.setName();


    }
}
